package com.TIEmulator.FileIOLib;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import java.util.ArrayList;
import java.util.List;

public class IconifiedTextListAdapter extends BaseAdapter
{
  private final Context mContext;
  private List<IconifiedText> mItems = new ArrayList();
  private float mSize;
  private boolean mSizeSet = false;

  public IconifiedTextListAdapter(Context paramContext)
  {
    this.mContext = paramContext;
  }

  public void addItem(IconifiedText paramIconifiedText)
  {
    this.mItems.add(paramIconifiedText);
  }

  public boolean areAllItemsSelectable()
  {
    return false;
  }

  public int getCount()
  {
    return this.mItems.size();
  }

  public Object getItem(int paramInt)
  {
    return this.mItems.get(paramInt);
  }

  public long getItemId(int paramInt)
  {
    return paramInt;
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    IconifiedTextView localIconifiedTextView;
    if (paramView == null)
      localIconifiedTextView = new IconifiedTextView(this.mContext, (IconifiedText)this.mItems.get(paramInt));
    while (true)
    {
      if (this.mSizeSet)
        localIconifiedTextView.setTextSize(this.mSize);
      return localIconifiedTextView;
      localIconifiedTextView = (IconifiedTextView)paramView;
      localIconifiedTextView.setText(((IconifiedText)this.mItems.get(paramInt)).getText());
      localIconifiedTextView.setIcon(((IconifiedText)this.mItems.get(paramInt)).getIcon());
    }
  }

  public boolean isSelectable(int paramInt)
  {
    return ((IconifiedText)this.mItems.get(paramInt)).isSelectable();
  }

  public void setListItems(List<IconifiedText> paramList)
  {
    this.mItems = paramList;
  }

  public void setTextSize(float paramFloat)
  {
    this.mSizeSet = true;
    this.mSize = paramFloat;
  }
}
